package cn.data.stream.config;


import cn.data.stream.annotation.EnableDataStreamConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @author shi hong yu
 */
@Slf4j
public class EnableDataStreamCondition implements Condition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        boolean annotated = metadata.isAnnotated(EnableDataStreamConfig.class.getName());
        log.info("data-stream 是否启用：{}",annotated);
        return annotated;
    }
}
